package top.lshaci.learning.springboot.jpaenhance.qo;

import io.gitee.lshaci.scmsaext.jpa.dsl.*;
import lombok.Data;
import top.lshaci.learning.springboot.jpaenhance.entity.QRoleEntity;
import top.lshaci.learning.springboot.jpaenhance.entity.QUserEntity;

/**
 * UserQo
 *
 * @author liangxu
 */
@Data
@DslFrom(QUserEntity.class)
@DslJoin(joinClass = QRoleEntity.class, joinField = "id", refField = "roleId")
public class UserQo extends AbstractDslQuery {

    @DslCondition(matcher = DslMatcher.LIKE)
    private String username;

    @DslCondition(fromClass = QRoleEntity.class, field = "name", matcher = DslMatcher.LIKE)
    private String roleName;
}
